
<script language="JavaScript">
function initIt(){
        divColl = document.all.tags("DIV");
        for (var i=0; i<divColl.length; i++) {
            whichEl = divColl(i);
            
            if (whichEl.className == "child") 
            {
                whichEl.style.display = "block";  
             }
        }
}
function expandIt(el,name,id) {
        whichEl = document.getElementById(el + "Child");
        if (whichEl.style.display == "none") {
            whichEl.style.display = "block";
        }
        else {
            whichEl.style.display = "none";
        }
}

var menuOn = "";
var blank = "&nbsp;&nbsp;&nbsp;";
var table_head = "<table border=0 width=100% style='margin:0' cellspacing=0 cellpadding=0><tr height=25 style='BACKGROUND-COLOR: #f2f2f0'><td style='BORDER-top: 1 solid #b1b1a8'>"
var table_middle = "</td></tr><tr style='BACKGROUND-COLOR: #f2f2f0;color:black'><td>";
var table_end = "</td></tr></table>"

</script>

<table class="clsContentTable" border=0 cellpadding=0>
<tr>
  <td width=14%>
    <div class="clsTaskMenu" align=center>


       <div class="clsTop">
          <table border=0 width=100%><tr height=25><td align="center">
            <font id='arrowHead' color='#e7e7e4'>→</font><a href="javascript:showPublishTaskPage()" style="color:blue">设置任务</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
          </td></tr></table>
       </div>



<script language="javascript">
<%index = 1%>
 <% for task in @tasks%>
          document.write(table_head+"<div id='p" + "<%=index%>" + "Parent'" + " class='parent'>");
          document.write("&nbsp;&nbsp;&nbsp;"+"<a class='clsMain' href='#' onClick=\"expandIt("+"'p<%=index%>'"+"); return false\">"+menuOn+"<%=task.name%>"+"</a>"+table_middle);
          document.write("<div id='p" + "<%=index%>" + "Child'" + " class='child'>");
          document.write(blank+"<font id='arrow"+"<%=index%>1'"+" color='#f2f2f0'>→</font>"+"<a class='clsChild' href=\"javascript:addressInfoManager("+"'<%=task.name%>'"+",'<%=task.id%>'"+",'<%=index%>'"+")\">催报管理</a><br>");
          document.write(blank+"<font id='arrow"+"<%=index%>2'"+" color='#f2f2f0'>→</font>"+"<a class='clsChild' href=\"javascript:unitManger("+"'<%=task.name%>'"+",'<%=task.id%>'"+",'<%=index%>'"+")\">单位管理</a><br>");
          document.write(blank+"<font id='arrow"+"<%=index%>3'"+" color='#f2f2f0'>→</font>"+"<a class='clsChild' href=\"javascript:permissionManager("+"'<%=task.name%>'"+",'<%=task.id%>'"+",'<%=index%>'"+")\">单位权限</a><br>");
          document.write(blank+"<font id='arrow"+"<%=index%>4'"+" color='#f2f2f0'>→</font>"+"<a class='clsChild' href=\"javascript:scriptManager("+"'<%=task.name%>'"+",'<%=task.id%>'"+",'<%=index%>'"+")\">脚本管理</a><br>");
          document.write(blank+"<font id='arrow"+"<%=index%>5'"+" color='#f2f2f0'>→</font>"+"<a class='clsChild' href=\"javascript:templateManager("+"'<%=task.name%>'"+",'<%=task.id%>'"+",'<%=index%>'"+")\">模板管理</a><br>");
          document.write(blank+"<font id='arrow"+"<%=index%>6'"+" color='#f2f2f0'>→</font>"+"<a class='clsChild' href=\"javascript:xsltManger("+"'<%=task.name%>'"+",'<%=task.id%>'"+",'<%=index%>'"+")\">表样发布</a><br>");
          document.write(blank+"<font id='arrow"+"<%=index%>7'"+" color='#f2f2f0'>→</font>"+"<a class='clsChild' href=\"javascript:articleManger("+"'<%=task.name%>'"+",'<%=task.id%>'"+",'<%=index%>'"+")\">报告管理</a><br>");
          document.write(blank+"<font id='arrow"+"<%=index%>8'"+" color='#f2f2f0'>→</font>"+"<a class='clsChild' href=\"javascript:tasktimeManager("+"'<%=task.name%>'"+",'<%=task.id%>'"+",'<%=index%>'"+")\">任务时间</a><br>");
          document.write(blank+"<font id='arrow"+"<%=index%>9'"+" color='#f2f2f0'>→</font>"+"<a class='clsChild' href=\"javascript:visibleManager("+"'<%=task.name%>'"+",'<%=task.id%>'"+",'<%=index%>'"+")\">可见性设置</a></br>");
          document.write(blank+"<font id='arrow"+"<%=index%>10'"+" color='#f2f2f0'>→</font>"+"<a class='clsChild' href=\"javascript:convertTask("+"'<%=task.name%>'"+",'<%=task.id%>'"+",'<%=index%>'"+")\">跨任务导数</a></div>"+table_end);
 <% 
 index += 1
 end %>
</script>　
   </div>

  </td>
  <td>
       <iframe id="taskFrame" name="taskFrame" width=100% FRAMEBORDER=0 height=100% scrolling=auto></iframe>
   </td>

</tr>
</table>


<script language="javascript">
var arrowNum = 11;

function setArrow(arrow,index){
   document.getElementById("arrowHead").color = "#e7e7e4";
   for(var i=1;i< <%=@tasks.length+1%>;i++){
       for(var j=1;j<arrowNum;j++){
         document.getElementById("arrow"+i+j).color = "#f2f2f0";
       }
   }
   document.getElementById("arrow"+index+arrow).color = "darkorange";
}
function setArrowHead(){
if(4>1){
   for(var i=1;i< <%=@tasks.length+1%>;i++){
       for(var j=1;j<arrowNum;j++){
         document.getElementById("arrow"+i+j).color = "#f2f2f0";
       }
   }
}
   document.getElementById("arrowHead").color = "darkorange";
}
function showPublishTaskPage(){
 setArrowHead();
 taskFrame.location = "/taskman/publish_task";
}

function addressInfoManager(taskName,taskID,index){
   setArrow(1,index);
   url = "/addressinfo/index/" + taskID;   
   taskFrame.location = encodeURI(url);
   
}

function unitManger(taskName,taskID,index)
{
   setArrow(2,index);
   url = '/unitmanager/index/'  + taskID ;
   taskFrame.location = encodeURI(url);
}

function permissionManager(taskName,taskID,index)
{
   setArrow(3,index);
   url = '/taskman/permition_manager/' + taskID;
   taskFrame.location = encodeURI(url);
}

function scriptManager(taskName,taskID,index){
   setArrow(4,index);
   url = "/taskman/script_manager/" + taskID;
   taskFrame.location = encodeURI(url);
}

function templateManager( taskName, taskID, index)
{
	setArrow( 5, index );
	url = '/taskman/template_manager/' + taskID;
 	taskFrame.location = encodeURI(url);
}

function xsltManger(taskName,taskID,index)
{
   setArrow(6,index);
   url = '/taskman/style_manager/' + taskID;
   taskFrame.location = encodeURI(url);
}

function articleManger(taskName,taskID,index)
{
   setArrow(7,index);
   url = '/taskman/article_manager/' + taskID;
   taskFrame.location = encodeURI(url);
}

function tasktimeManager(taskName, taskID, index)
{
   setArrow(8,index);
   url = "/taskman/tasktime_manager/" + taskID;
   taskFrame.location = encodeURI(url);
}

function visibleManager(taskName, taskID, index)
{
   setArrow(9,index);
   url = "/taskman/visible_manager/" + taskID;
   taskFrame.location = encodeURI(url);
}

function convertTask(taskName, taskID, index)
{
   setArrow(10,index);
   url = "/taskman/convert_task/" + taskID;
   taskFrame.location = encodeURI(url);
}

//初试化子菜单div
initIt();
//条件显示发布任务页面
if("true"=="true"){
   showPublishTaskPage();
}
</script>
